﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for OnlineTestHelper
/// </summary>
public class OnlineTestHelper
{
    public OnlineTestHelper()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    private static object key = new object();

    public static OnlineTestDataContext Context
    {
        get
        {

            if (!HttpContext.Current.Items.Contains(key))
            {
                var obj = new OnlineTestDataContext();
                HttpContext.Current.Items.Add(key, obj);
                return obj;
            }
            else
            {
                return (OnlineTestDataContext)HttpContext.Current.Items[key];
            }
        }
    }
}